package service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.ReplyDetailDao;
import entity.Page;
import entity.ReplyDetail;

@Service
public class ReplyDetailServiceImpl implements ReplyDetailService{

	@Autowired
	ReplyDetailDao replyDetailDao;

	@Override
	public Page<ReplyDetail> selectPage(Integer invid, Integer pageNo) {
		Page<ReplyDetail> page = new Page<>(pageNo);
		page.setTotalCount(replyDetailDao.selectCount(invid));
		page.setDataList(replyDetailDao.selectList(invid, page.getStartRow(), page.getPageSize()));
		return page;
	}

	@Override
	public boolean add(ReplyDetail detail) {
		return replyDetailDao.add(detail) > 0;
	}
	
	
}
